<template>
  <XTable :tableList="tableList" :tableData="tableData" />
</template>

<script>
import { XTable } from '@/components/@fhsy/x-tool'
export default {
  components: { XTable },
  data: () => ({
    tableList: [
      { label: '日期(截取)', prop: 'date', width: 200, x: { substring: [0, 10] } },
      { label: '姓名(空替换)', prop: 'name', empty: '---' },
      { label: '状态(判断)', prop: 'status', x: { if: [{ 0: '不可用' }, { 1: '可用' }] } },
      { label: '企业(循环)', prop: 'brand', x: { for: true, forSeparator: '，' } }
    ],
    tableData: [
      { date: '2020-05-02 12:30:40', name: '白羊', status: 1, brand: '["阿里", "华为"]' },
      { date: '2020-06-04 12:30:40', name: '', status: 0, brand: ['百度'] },
      { date: '2020-07-01 12:30:40', name: null, status: 0, brand: ['小米'] },
      { date: '2020-08-03 12:30:40', name: undefined, status: 1, brand: ['腾讯', '阿里', '京东'] }
    ]
  })
}
</script>
